package org.example.Test;

import java.io.IOException;

public class ProcessBuilderUtils {
    public static void main(String[] args) {

/*
wc -l filename | awk
 */
                ProcessBuilder processBuilder = new ProcessBuilder("bash", "-c", "cd /home/user1 && split -b 10M bigfile.txt splitfile");

                try {
                    Process process = processBuilder.start();
                    int i = process.waitFor();
                    System.out.println(i);
                    System.out.println("Commands executed successfully");
                } catch (IOException | InterruptedException e) {
                    e.printStackTrace();
                }
    }
}
